package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.InventoryDetail;

public interface InventoryDetailRepository extends JpaRepository<InventoryDetail, String>{

	//根据key得数据
	@Query(" select i from InventoryDetail i where i.name like '%'+?1+'%' or i.figureNum like '%'+?1+'%' or i.material like '%'+?1+'%' ")
	Page<InventoryDetail> getInventoryDetail(String key,Pageable pageable);
	//根据key得数据条数
	@Query(" select count(*) from InventoryDetail i where i.name like '%'+?1+'%' or i.figureNum like '%'+?1+'%' or i.material like '%'+?1+'%' ")
	  long findCount(String key);
}
